using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using ConsoleApplication1.Models.Mapping;

namespace ConsoleApplication1.Models
{
    public class ByteartRetailContext : DbContext
    {
        static ByteartRetailContext()
        {
            Database.SetInitializer<ByteartRetailContext>(null);
        }

		public ByteartRetailContext()
			: base("Name=ByteartRetailContext")
		{
		}

        public DbSet<Customer> Customers { get; set; }
        public DbSet<Laptop> Laptops { get; set; }
        public DbSet<SalesLine> SalesLines { get; set; }
        public DbSet<SalesOrder> SalesOrders { get; set; }
        public DbSet<ShoppingCartItem> ShoppingCartItems { get; set; }
        public DbSet<ShoppingCart> ShoppingCarts { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new CustomerMap());
            modelBuilder.Configurations.Add(new LaptopMap());
            modelBuilder.Configurations.Add(new SalesLineMap());
            modelBuilder.Configurations.Add(new SalesOrderMap());
            modelBuilder.Configurations.Add(new ShoppingCartItemMap());
            modelBuilder.Configurations.Add(new ShoppingCartMap());
        }
    }
}
